<extend name="template/base_index" />

<block name="area_header">

	<link rel="stylesheet" href="__CSS__/buysell.css">
</block>

<block name="area_body">
	<div class="head">
		<a href="{:U('Mybuysell/mysell')}"><i class="fa fa-chevron-left"></i></a>
		<span>我要发货</span>
	</div>
	<form action="{:U('Mybuysell/send_good')}" method="post" id="expressform">
			<div class="weui_cells">
				<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<p>物流公司</p>
					</div>
					<div class="weui_cell_ft">
						<input type="hidden" value="{$uid}" name="uid">
						<input type="hidden" value="{$order_code}" name="order_code">
						<input type="text" class="weui_input" name="expressname" id="selectexpress" value="">
						<input type="hidden" name="expresscode" id="code">
					</div>
				</div>
				<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<p>快递单号</p>
					</div>
					<div class="weui_cell_ft">
						<input type="text" class="weui_input" name="expressno" placeholder="比如：6859659668965" >
					</div>
				</div>
			</div>
			<center>
				<a onclick="sendinfo()" class="send_btn weui_btn weui_btn_warn">确定发货</a>
			</center>
	</form>
	<script src="__JS__/jquery-weui.min.js"></script>
	<script type="text/javascript">
		$("#selectexpress").select({
		title: "选择快递公司",
		items: [
				{
					title: "申通快递",
					value: "shentong",
				},
				{
					title: "中通快递",
					value: "zhongtong",
				},
				{
					title: "圆通快递",
					value: "yuantong",
				},
				{
					title: "韵达快递",
					value: "yuantong",
				},
				{
					title: "邮政EMS",
					value: "ems",
				},
				{
					title: "顺丰快递",
					value: "shunfeng",
				},
				{
					title: "天天快递",
					value: "tiantian",
				},
				{
					title: "国通快递",
					value: "guotongkuaidi",
				},
				{
					title: "汇通快运",
					value: "huitongkuaidi",
				},
				{
					title: "联邦快递（国内）",
					value: "lianb",
				},
				{
					title: "全晨快递",
					value: "quanchenkuaidi",
				},
				{
					title: "全峰快递",
					value: "quanfengkuaidi",
				},
				{
					title: "运通快递",
					value: "yuntongkuaidi",
				},
				{
					title: "中铁快运",
					value: "zhongtiekuaiyun",
				},
				{
					title: "aae全球专递",
					value: "aae",
				},
				{
					title: "安捷快递",
					value: "anjie",
				},
				{
					title: "安信达快递",
					value: "anxindakuaixi",
				},
				{
					title: "彪记快递",
					value: "biaojikuaidi",
				},
				{
					title: "优速物流",
					value: "youshuwuliu",
				},
				{
					title: "百福东方国际物流",
					value: "baifudongfang",
				},

			]
		});

		function sendinfo(){
			//这里缺少表单验证后期补上
			var expresscode = $('#selectexpress').attr('data-values');
			if($("[name='expressno']").val() != '' && expresscode != undefined){
				$('#code').attr('value',expresscode);
				$('#expressform').submit();
			}else{
				$.toptip('信息不完整', 'error');
			}
		}
	</script>
</block>